<?php
/**
 * CopyConst.php class file.
 * @author wudg <544038230@qq.com>
 * @date 2021/1/17- 下午4:43
 */

namespace common\constants;


class CopyConst
{
    /**
     * 复制到店铺
     */
    const COPY_TO_SHOP = 2;


    /**
     * 复制到云库
     */
    const COPY_TO_CLOUD = 1;



    /**
     * 采集中
     */
    const COPY_SPIDER_ING = 0;


    /**
     * 采集结束
     */
    const COPY_SPIDER_YES = 1;

    /**
     * 复制中
     */
    const COPY_ING = 2;

    /**
     * 复制成功
     */
    const COPY_YES = 3;


    /**
     * 复制失败
     */
    const COPY_FAILED = 5;


    /**
     * 已过滤
     */
    const COPY_FILTER = 6;

    /**
     * 已取消
     */
    const COPY_CANCEL = 7;

    public static function recordStatus(int $status)
    {
        $statusName = '';
        switch ($status)
        {
            case self::COPY_SPIDER_ING:
                $statusName = '采集中';
                break;
            case self::COPY_SPIDER_YES:
            case self::COPY_ING:
                $statusName = '复制中';
                break;
            case self::COPY_YES:
                $statusName = '复制成功';
                break;
            case self::COPY_FAILED:
                $statusName = '复制失败';
                break;
            case self::COPY_FILTER:
                $statusName = '已过滤';
                break;
            case self::COPY_CANCEL:
                $statusName = '已取消';
                break;
        }

        return $statusName;
    }


    /**
     * 批次复制中
     */
    const COPY_BATCH_ING = 1;


    /**
     * 批次复制结束
     */
    const COPY_BATCH_OVER = 2;



    public static function batchLogStatus(int $status)
    {
        $statusName = '';
        switch ($status) {
            case self::COPY_BATCH_ING:
                $statusName = '复制中';
                break;
            case self::COPY_BATCH_OVER:
                $statusName = '复制结束';
                break;
        }
        return $statusName;
    }



    public static function toCopyName(int $toCopy)
    {
        $toCopyName = '';
        switch ($toCopy)
        {
            case 1:
                $toCopyName = '复制到云库';
                break;
            case 2:
                $toCopyName = '复制到店铺';
                break;
        }
        return $toCopyName;
    }
}